package android.resources;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.MotionEvent;

public class ClearGLSurfaceView extends GLSurfaceView {
	ClearRenderer mRenderer;
	
	public ClearGLSurfaceView(Context context) {
		super(context);
		mRenderer = new ClearRenderer();
		setRenderer(mRenderer);
	}
	
	public boolean onTouchEvent(final MotionEvent event) {
		queueEvent(new Runnable(){
		    public void run() {
		        mRenderer.setColor(event.getX() / getWidth(),
		                event.getY() / getHeight(), 1.0f);
		    }
		});
		return true;
	}
}